using System;
using System.Collections.Generic;
using System.Text;
using ACS.Runtime.Visitors;

namespace ACS.Runtime.Types
{
    public class IntType : BaseType
    {
        private int _val;


        public int Val
        {
            get { return _val; }
        }


        public IntType()
        {
        }

        public IntType(int val)
        {
            _val = val;
        }

        public static implicit operator IntType(int value)
        {
            return new IntType(value);
        }

        public static implicit operator int(IntType value)
        {
            return value.Val;
        }

        public override int Accept(IVisitor visitor)
        {
            return visitor.Visit(this); 
        }

        public static bool operator ==(IntType b1, IntType b2)
        {
            return b1._val == b2._val;
        }

        public static bool operator !=(IntType b1, IntType b2)
        {
            return b1._val != b2._val;
        }

        public override void Assign(BaseType from)
        {
            Assign((IntType)from);
        }

        public void Assign(IntType from)
        {
            _val = from._val;
        }
    }
}
